//
//  SongListTypeCollectionViewCell.m
//  YHYRealx
//
//  Created by yanghuiyan on 16/5/3.
//  Copyright © 2016年 yanghuiyan. All rights reserved.
//

#import "SongListTypeCollectionViewCell.h"

@implementation SongListTypeCollectionViewCell

- (void)dealloc {
    
    [_label release];
    [super dealloc];
    
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor colorWithRed:0.16 green:0.20 blue:0.25 alpha:1.00];
        _label = [YHYBaseLabel new];
        _label.font = [UIFont systemFontOfSize:16];
        _label.textAlignment = NSTextAlignmentCenter;
        _label.layer.borderWidth = 1.0f;
        _label.textColor = [UIColor colorWithRed:0.49 green:0.51 blue:0.53 alpha:1.00];
        _label.backgroundColor = [UIColor colorWithRed:0.13 green:0.17 blue:0.21 alpha:1.00];
        [self.contentView addSubview:_label];
        
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    [_label mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView).offset(5);
        make.left.equalTo(self.contentView).offset(5);
        make.right.equalTo(self.contentView).offset(-5);
        make.bottom.equalTo(self.contentView).offset(-5);
        
    }];
}

- (void)setTypeModel:(SongListTypeChlidrenModel *)typeModel {
    if (_typeModel != typeModel) {
        [_typeModel release];
        _typeModel = [typeModel retain];
    }
//    NSLog(@"%@", typeModel.tag);
    _label.text = typeModel.tag;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
